<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <!-- 键盘弹起触发，并且要enter键弹起 -->
      <input @keyup.enter="fn" type="text" />
      <!-- 代表由a键触发 -->
      <input @keyup.a="fn" type="text" />
      <button>登录</button>
    </div>

    <script src="./vue.js"></script>
    <script>
      new Vue({
        el: '#app',
        methods: {
          fn () {
            console.log('做登录')
          }
        }
      })
    </script>
  </body>
</html>
